#ifndef PROX_SENSORS_H_
#define PROX_SENSORS_H_

#include "lpc_types.h"

#define LF_PORT     0
#define LF_PIN      23              // p15  |  LF
#define LF_FUNC     PINSEL_FUNC_1
#define LF_CHAN     ADC_CHANNEL_0

#define RF_PORT     0
#define RF_PIN      24              // p16  |  RF
#define RF_FUNC     PINSEL_FUNC_1
#define RF_CHAN     ADC_CHANNEL_1

#define RR_PORT     0
#define RR_PIN      25              // p17  |  RR
#define RR_FUNC     PINSEL_FUNC_1
#define RR_CHAN     ADC_CHANNEL_2

#define LR_PORT     1
#define LR_PIN      30              // p19  |  LR
#define LR_FUNC     PINSEL_FUNC_3
#define LR_CHAN     ADC_CHANNEL_4

#define FRONT_SENS  1 << 17

typedef enum
{
    LF_SENSOR = 0,
    RF_SENSOR,
    RR_SENSOR,
    LR_SENSOR
} PROX_SENSOR_SELECTION;

#define PARAM_PROX_SENSORS_SEL(SEL )\
((SEL == LF_SENSOR)||(SEL == RF_SENSOR)||(SEL == RR_SENSOR)||(SEL == LR_SENSOR))

void init_proximity_sensors(void); // initialise module
uint16_t read_sensor_value(PROX_SENSOR_SELECTION); // read voltage of sensors
uint8_t read_sensor_distance(PROX_SENSOR_SELECTION); // read distance (cm)
uint8_t read_front_sensor(); // read front sensor

#endif